<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>数字微调器的步长 - jQuery EasyUI 演示</title>
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">
	<script type="text/javascript" src="../../jquery.min.js"></script>
	<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
	<script type="text/javascript">
		function ocV1(nV,oV){toCalc(nV,null);}
		function ocV2(nV,oV){toCalc(null,nV);}
		function toCalc(v1,v2){
			if(!v1){v1=$('#nsp1').numberspinner('getValue');}
			if(!v2){v2=$('#nsp2').numberspinner('getValue');}
			$('#nsp3').numberspinner('setValue', v1*v2/100);	// 注：得去掉步长，否则设值无效。
		}
	</script>
</head>
<body>
	<h2 title="Increment Number">数字微调器的步长</h2>
	<p title="The sample shows how to set the increment step.">　　本例展示如何设置单位增量（即步长，如下所示分别为 100、10）。</p>
	<div class="easyui-panel" style="width:100%;max-width:200px;padding:10px 20px;">
		<div style="margin-bottom:10px">
			<input id="nsp1" class="easyui-numberspinner" value="1000" data-options="label:'报价：百',labelPosition:'left',labelWidth:60,labelAlign:'right',increment:100,min:1,max:99999,onChange:ocV1,onSpinUp:toCalc,onSpinDown:toCalc" style="width:100%;">
		</div>
		<div style="margin-bottom:10px">
			<input id="nsp2" class="easyui-numberspinner" value="100" data-options="label:'折扣：十',labelPosition:'left',labelWidth:60,labelAlign:'right',increment:10,suffix:'%',min:0,max:100,onChange:ocV2,onSpinUp:toCalc,onSpinDown:toCalc" style="width:100%;">
		</div>
		<div style="margin-bottom:0px">
			<input id="nsp3" class="easyui-numberspinner" value="1000" data-options="label:'金额：算',labelPosition:'left',labelWidth:60,labelAlign:'right',precision:2,readonly:true" style="width:100%;">
		</div>
	</div>
</body>
</html>